<template>
  <div class="trainBuy">
    <form @click='formSubmit'>
      <div class="wrap">
        <!--购物清单-->
        <div class="form-item a">
          <p class="way">购物清单</p>
          <div class="qd">
            <p>☺</p>
            <p>这是一个报名清单</p>
          </div>
        </div>
        <!-- 报名方式 -->
        <div class="form-item">
          <p class="way">购物者信息</p>
          <p class="name">姓名</p>
          <input name="input" type="text" placeholder="请填写您的真实姓名"
                 class="input-name"/>
          <p class="phone">手机号</p>
          <input name="input" type="number" placeholder="请填写有效手机号码"
                 class="input-phone"/>
        </div>
        <!-- 报名金额 -->
        <div class="form-money">
          <p class="money-left">购买金额</p>
          <p class="money-text">￥ {{prize}}</p>
        </div>
      </div>
      <div class="fixed" @click="sureApply">
        <p>确认购买</p>
      </div>
    </form>
  </div>
</template>

<script>
  import Swiper from '@/components/swiper/Swiper'
  import axios from 'axios'

  export default {
    name: "trainBuy",
    data() {
      return {
        prize: 400,
        imgList: [],
      }
    },
    components: {
      Swiper
    },
    methods: {
      formSubmit() {

      },
      sureApply() {

      },
      agreeApply() {

      },
      getHomeInfo() {
        axios.get('static/all.json')
          .then(this.getHomeInfoSucc)
      },
      getHomeInfoSucc(res) {
        if (res.data) {
          this.imgList = res.data.imgList
        }
      },
    },
    mounted() {
      this.getHomeInfo()
    },
  }
</script>

<style scoped lang="less">

  .wrap {
    padding: 10px;
    .form-item {
      margin-bottom: 28px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      font-size: 14px;
      color: #666;
      .way {
        font-size: 14px;
        padding: 3px 14px 3px 14px;
        background: #1bbacd;
        border-radius: 2px;
        text-align: center;
        color: #fff;
        margin-bottom: 20px;
      }
      .qd {
        font-size: 14px;
        font-weight: bold;
        width: 100%;
        padding: 10px 0 10px 0;
        text-align: center;
      }
      .name, .phone {
        padding-left: 3%;
      }
      .input-name, .input-phone {
        width: 94%;
        margin: 10px auto;
        height: 30px;
        padding-left: 8px;
        background: #f5f5fa;
        border: 1px solid #e6e6ed;
        border-radius: 5px;
        font-size: 14px;
      }

    }
    .form-money {
      width: 94%;
      margin:auto;
      display: flex;
      padding: 20px 0 20px 0;
      border-top: 1px solid #cdcdd3;
      justify-content: space-between;
      font-size: 14px;
      color: #666;
    }
  }

  .fixed {
    width: 100%;
    height: 42px;
    line-height: 42px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    bottom: 0;
    left: 0;
    position: fixed;
    background: #ffac66;
  }


</style>
